struct Solution {}

impl Solution {
  pub fn corp_flight_bookings(bookings: Vec<Vec<i32>>, n: i32) -> Vec<i32> {
      let mut diff = vec![0; n as usize];
      bookings.iter().for_each(|r| {
        diff[r[0] as usize - 1] += r[2];
        if r[1] < n {
          diff[r[1] as usize] -= r[2];
        }
      });
      let mut curr = 0;
      diff.iter().map(|x| {
        curr += x;
        curr
      }).collect()
  }
}